import { GET } from '@/utils/request'

/**
 * 获取附件下载签名
 * @param {Number} fileId 附件id
 */
export const getFileSign = (fileId) => GET(`/project/resource/${ fileId }/sign/download`)
/**
 * 获取文档的html内容
 */
export const getFileHtml = (sign) => axios.get(`https://${ sign.bucketName }.cos.${ sign.region }.myqcloud.com${ sign.filename }`, {
  params: {
    'ci-process': 'doc-preview',
    'dstType': 'html',
    'sign': sign.authorization,
    'copyable': '0', // 不可复制
    'weboffice_url': '1'
  }
})
